package com.trmq.config;

import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/3/5  10:47
 * 描述:
 */
@Configuration
public class TestRabbitMq {

    @Bean
    public Queue queue(){
        return new Queue("redis-queue",true);
    }


    @Bean
    public Exchange exchange(){
        return ExchangeBuilder.directExchange("redis-exchange").durable(true).build();
    }

    @Bean
    public Binding binding(Queue queue,Exchange exchange){
        return BindingBuilder.bind(queue).to(exchange).with("redis-key").noargs();
    }


}
